package com.tongda.menu.widget;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class CustomViewPager extends ViewPager{

    private boolean willIntercept = true;
    
	public CustomViewPager(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

    @Override
    public boolean onInterceptTouchEvent(MotionEvent arg0) {
            if(willIntercept){
                    //这个地方直接返回true会很卡
                    return super.onInterceptTouchEvent(arg0);
            }else{
                    return false;
            }
            
    }
    
    public void setTouchIntercept(boolean value){
        willIntercept = value;
   }
    
}
